refactor(jpa): apply Hibernate-safe equals and hashCode implementations#1089
refactor(jpa): apply Hibernate-safe equals and hashCode implementations#1089balazs-szucs wants to merge 5 commits intogrimmory-tools:developfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🧰 Additional context used📓 Path-based instructions (3)backend/src/**/*.java📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*⚙️ CodeRabbit configuration file
Files:
**/entity/**/*.java⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (2)📚 Learning: 2026-04-10T08:15:37.436ZApplied to files:
📚 Learning: 2026-04-14T12:43:08.698ZApplied to files:
🔇 Additional comments (8)
WalkthroughEight JPA entity classes are updated to use Hibernate-aware proxy-safe equality and hashing implementations. Each entity's ChangesEntity Equality & Hashing Modernization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 5/8 reviews remaining, refill in 17 minutes and 8 seconds.Comment |
Description
Resolves the JPA Buddy warning:
This change establishes a consistent, reliable, and Hibernate-safe equals() and hashCode() implementation across the codebase. By utilizing org.hibernate.Hibernate.getClass() and getter methods, it ensures entities are compared accurately, even when wrapped in lazy-loaded proxies.
Linked Issue
Changes
Entity equality and hash code standardization:
AuthorEntity,BookEntity,BookLoreUserEntity,CategoryEntity,LibraryEntity,MoodEntity,ShelfEntity,TagEntity) to useHibernate.getClass(this)andgetId()in theirequalsandhashCodeimplementations, making them final and proxy-safe.Manual Testing Steps
Screenshots (Optional)
Additional Context (Optional)
AI Disclosure
Checklist
just ui checkandjust api check.Summary by CodeRabbit